How to mount bootable drives in VHD format in XenServer VM
This is a mini guide to the chapter on swapping formats between Virtual Machine Manager.
In this case we have native Microsoft Virtual Server VMs and we want to mount them on XenServer.
The issue is simplified by the fact that they both use the VHD format as virtual disks.
The operations to be carried out are as follows:
Create an external EXT SR storage (example a NAS) with the XenCenter and copy the .vhd file to it.
Now through the SSH console we connect to the XenServer hypervisor and we can see a new folder in the path
/var/run/sr-mount/
Now we need to generate a new UUID using the command
uuidgen
and change the name of the .vhd file with the last one we generated
Now we need to refresh the database using the command:
xe sr-scan uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
where you need to put the EXT SR folder instead of the x
Now we can go back to the XenCenter and create a new VM from template, be careful not to start it; once defined we delete the default disk and “attach” our disk under EXT SR and now we can boot the VM.
If the disk was bootable, we will see the VM boot and probably only have driver problems to update.
That’s it